#pragma once
#pragma warning(disable:4996)       // disable checked iterator errors http://msdn.microsoft.com/en-us/library/aa985965(VS.80).aspx 

//
// Copyright (C) 2011 Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.101

#include <Macros.h>
#include <CoVector.h>
#include <CoMatrix.h>
#include <CoCube.h>
#include <ValueHelpers.h>
#include <Settings.h>

#include <gen/QL/Index.h>
#pragma unmanaged 
#include <ql\indexes\inflationindex.hpp>
#include <boost/smart_ptr/detail/spinlock.hpp>
#pragma managed 

using namespace System;
using namespace QuantLib;
using namespace Cephei;

using namespace Cephei::QL::Times;
using namespace Cephei::QL;
#define HANDLE
#define ABSTRACT
#undef STRUCT
namespace Cephei { namespace QL { namespace Indexes {
	//////////////////////////////////////////////////////////////////////////////////////////////
	// implementation of IInflationIndex
	public ref class CInflationIndex : 
            public CIndex,
            public Cephei::QL::Indexes::IInflationIndex
	{
	protected: 
		boost::shared_ptr<QuantLib::InflationIndex>* _ppInflationIndex;
#ifdef HANDLE
		QuantLib::Handle<QuantLib::InflationIndex>* _phInflationIndex;
#endif
		Object^ _InflationIndexOwner;     // reference to object that manages the storage for this object
	internal:
        CInflationIndex (boost::shared_ptr<QuantLib::InflationIndex>& childNative, Object^ owner);
        CInflationIndex (QuantLib::InflationIndex& childNative, Object^ owner);
        CInflationIndex (CInflationIndex^ copy);
        CInflationIndex (System::Type^ t);
#ifdef STRUCT
        CInflationIndex (QuantLib::InflationIndex childNative);
#endif       
#ifdef HANDLE
		CInflationIndex (QuantLib::Handle<QuantLib::InflationIndex>& childNative, Object^ owner);
		CInflationIndex (QuantLib::Handle<QuantLib::InflationIndex> childNative);
#endif
		virtual ~CInflationIndex ();
		!CInflationIndex ();

	internal:
		QuantLib::InflationIndex& GetReference ();
		boost::shared_ptr<QuantLib::InflationIndex>& GetShared ();
		QuantLib::InflationIndex* GetPointer ();
        void SetInflationIndex (boost::shared_ptr<QuantLib::InflationIndex> native)
        {
            if (_ppInflationIndex != NULL)
                delete _ppInflationIndex;
            _ppInflationIndex = new boost::shared_ptr<QuantLib::InflationIndex> (native);
            SetIndex (boost::dynamic_pointer_cast<QuantLib::Index> (*_ppInflationIndex));
        }
#ifdef HANDLE
		QuantLib::Handle<QuantLib::InflationIndex>& GetHandle ();
#endif
		virtual bool HasNative () override;
    public:
		virtual Cephei::QL::Indexes::IInflationIndex^ AddFixing (DateTime fixingDate, Double fixing, Microsoft::FSharp::Core::FSharpOption<Boolean>^ forceOverwrite) ;
        property Cephei::QL::Times::IPeriod^ AvailabilityLag 
        {
		    virtual Cephei::QL::Times::IPeriod^ get () ;
        }
        property Cephei::QL::ICurrency^ Currency 
        {
		    virtual Cephei::QL::ICurrency^ get () ;
        }
        property String^ FamilyName 
        {
		    virtual String^ get () ;
        }
		virtual Double Fixing (DateTime fixingDate, Microsoft::FSharp::Core::FSharpOption<Boolean>^ forecastTodaysFixing) ;
        property Cephei::QL::Times::ICalendar^ FixingCalendar 
        {
		    virtual Cephei::QL::Times::ICalendar^ get () ;
        }
        property QL::Times::FrequencyEnum Frequency 
        {
		    virtual QL::Times::FrequencyEnum get () ;
        }
        property Boolean Interpolated 
        {
		    virtual Boolean get () ;
        }
		virtual Boolean IsValidFixingDate (DateTime fixingDate) ;
        property String^ Name 
        {
		    virtual String^ get () ;
        }
        property Cephei::QL::Indexes::IRegion^ Region 
        {
		    virtual Cephei::QL::Indexes::IRegion^ get () ;
        }
        property Boolean Revised 
        {
		    virtual Boolean get () ;
        }
        property Cephei::QL::Indexes::IInflationIndex^ Update 
        {
		    virtual Cephei::QL::Indexes::IInflationIndex^ get () ;
        }
    };
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Factory class
	public ref class CInflationIndex_Factory : public System::MarshalByRefObject,  public IInflationIndex_Factory
	{
	public:
    };
   
/*Cephei*/ } /*QL*/ } /*Indexes */}
